package com.yuyou.train.lesson.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.train.lesson.mapper.LessonResourceRuleFrameMapper;
import com.yuyou.train.lesson.service.ILessonResourceRuleFrameService;
import com.yuyou.train.service.api.lesson.entity.LessonResourceRuleFrame;
import com.yuyou.train.util.tool.Sequence;
import com.yuyou.train.util.tool.UUIDUtil;

@Service
public class LessonResourceRuleFrameServiceImpl implements ILessonResourceRuleFrameService{

	@Autowired
	private LessonResourceRuleFrameMapper lessonResourceRuleFrameMapper;
	
	@Override
	public int deleteByPrimaryKey(String id) {
		return lessonResourceRuleFrameMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(LessonResourceRuleFrame record) {
		record.setId(Sequence.getSequence().getNextId());
		record.setCreateTime(new Date());
		return lessonResourceRuleFrameMapper.insert(record);
	}

	@Override
	public LessonResourceRuleFrame selectByPrimaryKey(String id) {
		return lessonResourceRuleFrameMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(
			LessonResourceRuleFrame record) {
		return lessonResourceRuleFrameMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int deleteByLessonId(String lessonId) {
		return lessonResourceRuleFrameMapper.deleteByLessonId(lessonId);
	}

	@Override
	public List<LessonResourceRuleFrame> findFrameByQuestionId(String questionId) {
		return lessonResourceRuleFrameMapper.findFrameByQuestionId(questionId);
	}

	@Override
	public List<LessonResourceRuleFrame> findFrameByLessonId(String lessonId) {
		return lessonResourceRuleFrameMapper.findFrameByLessonId(lessonId);
	}


}